package com.yystudy.example.provider;

import com.yystudy.example.common.service.UserService;
import com.yystudy.rpc.RpcApplication;
import com.yystudy.rpc.config.RpcConfig;
import com.yystudy.rpc.register.LocalRegistry;
import com.yystudy.rpc.server.HttpServer;
import com.yystudy.rpc.server.VertxHttpServer;

/**
 * 简易服务提供者示例
 *
 */
public class EasyProviderExample {

    public static void main(String[] args) {
        // 注册服务
        LocalRegistry.register(UserService.class.getName(), UserServiceImpl.class);

        // 启动 web 服务
        HttpServer httpServer = new VertxHttpServer();
        RpcConfig rpcConfig = RpcApplication.getRpcConfig();
        System.out.println("加载配置：" + rpcConfig);
        httpServer.doStart(rpcConfig.getServerPort());
    }
}